package co.fitstart.entity.site;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.annotations.Type;

/**
 * 
 * @author mohanlan
 *
 */
public class SiteRoomLimit {
    
    /** 公共区域容量 */
    private int commonLimit;
    
    /** 公共区域解释 */
    @Type(type = "text")
    private String commonDescription;
    
    /** 私密区域容量 */
    private int roomLimit;
    
    /** 私密区域解释 */
    @Type(type = "text")
    private String roomDescription;
    
    /**
     * The default constructor
     */
    public SiteRoomLimit() {
    }
    
    public SiteRoomLimit initialize() {
        this.commonLimit = 0;
        this.roomLimit = 0;
        return this;
    }
    
    /**
     * 
     * @return
     */
    public List<String> getLimit() {
        List<String> limits = new ArrayList<String>();
        if(roomLimit > 0) {
            limits.add("room");
        }
        if(commonLimit > 0) {
            limits.add("common");
        }
        return limits;
    }

    /**
     * @return the commonLimit
     */
    public int getCommonLimit() {
        return commonLimit;
    }

    /**
     * @return the commonDescription
     */
    public String getCommonDescription() {
        return commonDescription;
    }

    /**
     * @return the roomLimit
     */
    public int getRoomLimit() {
        return roomLimit;
    }

    /**
     * @return the roomDescription
     */
    public String getRoomDescription() {
        return roomDescription;
    }

    /**
     * @param commonLimit the commonLimit to set
     */
    public void setCommonLimit(int commonLimit) {
        this.commonLimit = commonLimit;
    }

    /**
     * @param commonDescription the commonDescription to set
     */
    public void setCommonDescription(String commonDescription) {
        this.commonDescription = commonDescription;
    }

    /**
     * @param roomLimit the roomLimit to set
     */
    public void setRoomLimit(int roomLimit) {
        this.roomLimit = roomLimit;
    }

    /**
     * @param roomDescription the roomDescription to set
     */
    public void setRoomDescription(String roomDescription) {
        this.roomDescription = roomDescription;
    }
}
